<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
/**
 * Prunus Buffer
 *
 * Buffer para controlar la salida de los controles prunus
 *
 * @author		agosto
 * @date		  20090704
 * @version		0.1
 * @copyright	Copyright (c) 2009, 7dedos
 * @link		http://www.7dedos.com.ar
 */
 
/**
 * Prunus Buffer
 *
 * Buffer para controlar la salida de los controles prunus
 *
 * @author		agosto
 * @date		  20091212
 * @version		0.2
 * @copyright	Copyright (c) 2009, 7dedos
 * @link		http://www.7dedos.com
 */
 
class PrunusBuffer {
	private $ci;
  private $buffer;
  private $offsetPosition;
    
	public function __construct($offset)	{
		$this->ci =& get_instance();
    $this->offsetPosition = $offset;
    $this->buffer = '';
		log_message('debug', 'prunus_buffer inicializado');
	}
	
  public function clear($offset = null) { 
    $this->buffer = ''; 
    if ($offset !== null) $this->offsetPosition = $offset;
  }
  
  public function addLine($position, $text) { 
    $this->buffer .= $this->ci->prunuslib->gi(($this->offsetPosition + $position), $text); 
  }
  
  public function get() {
    return $this->buffer;
  }
}
